home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
301-325
/
disk_319
/
cnewssrc
/
cnews.src.lzh
/
libfake
/
memcpy.c
< prev
next >
Wrap
C/C++ Source or Header
|
1980-01-01
|
430b
|
32 lines
/*
* memcpy - copy bytes
*/
char *
memcpy(dst, src, size)
char * dst;
char * src;
int size;
{
register char *d;
register char *s;
register int n;
if (size <= 0)
return(dst);
s = src;
d = dst;
if (s <= d && s + (size-1) >= d) {
/* Overlap, must copy right-to-left. */
s += size-1;
d += size-1;
for (n = size; n > 0; n--)
*d-- = *s--;
} else
for (n = size; n > 0; n--)
*d++ = *s++;
return(dst);
}